import {HTTP} from "../utils/http.js";
class LikeModel extends HTTP{
  /**
   * 点赞
   */
  like(likeOrCanecel, artId , category){
    let url = likeOrCanecel === "like" ? "like" : "like/cancel";
    this.request({
      url:url,
      method:"POST",
      data: { 
        art_id:artId,
        type: category
      }
    });
  }
  /**
   * 获取点赞信息
   * @param {0} cid 点赞对象性的id
   * @param {1} type 点赞类型
   * @param {2} sCallBack 回调函数
   */
  getClassicLikeStatus(cid , type , sCallBack){
    this.request({
      url:`classic/${type}/${cid}/favor`,
      success:sCallBack,
    });
  }
}

export { LikeModel }